hysop.backend.host.host_array module¶
- class hysop.backend.host.host_array.HostArray(handle, backend, **kwds)[source]¶
Bases:
Array
Host memory array wrapper. An HostArray is a numpy.ndarray work-alike that stores its data and performs its computations on CPU with numpy.
Build an HostArray instance.
- Parameters:
handle (numpy.ndarray) – implementation of this array
backend (HostArrayBackend) – backend used to build this handle
kwds – arguments for base classes.
Notes
This should never be called directly by the user. Arrays should be constructed using array backend facilities, like zeros or empty. The parameters given here refer to a low-level method for instantiating an array.
- property T¶
Same as self.transpose(), except that self is returned if self.ndim < 2.
- as_symbolic_array(name, **kwds)[source]¶
Return a symbolic array variable that contain a reference to this array.
- as_symbolic_buffer(name, **kwds)[source]¶
Return a symbolic buffer variable that contain a reference to this array.
- astype(dtype, order=SAME_ORDER(3), casting='unsafe', subok=True, copy=True)[source]¶
Copy of the array, cast to a specified type.
- property base¶
Base object if memory is from some other object.
- property ctypes¶
An object to simplify the interaction of the array with the ctypes module.
- property data¶
Buffer object pointing to the start of the array’s data
- property dtype¶
numpy.dtype representing the type stored into this buffer.
- property flags¶
Information about the memory layout of the array.
- get_strides()[source]¶
Tuple of ints that represents the byte step in each dimension when traversing an array.
- property imag¶
The imaginary part of the array.
- property int_ptr¶
Return the underlying buffer pointer as an int.
- property itemsize¶
Number of bytes per element.
- property nbytes¶
Number of bytes in the whole buffer.
- property ndim¶
Number of array dimensions.
- property offset¶
Offset of array data in buffer.
- property real¶
The real part of the array.
- set_shape(shape)[source]¶
Set the shape of this buffer. From the numpy doc: It is not always possible to change the shape of an array without copying the data. If you want an error to be raised if the data is copied, you should assign the new shape to the shape attribute of the array.
- property shape¶
The real shape of this buffer.
- property size¶
Number of elements in the array.
- property strides¶
Tuple of ints that represents the byte step in each dimension when traversing an array.
- take(indices, axis=None, out=None, mode='raise')[source]¶
Return an array formed from the elements of a at the given indices.
- tofile(fid, sep='', format='%s')[source]¶
Write array to a file as text or binary (default). This is a convenience function for quick storage of array data. Information on endianness and precision is lost.